package model;

/**
 * The {@link VisiblePartsCachedState} class is a {@link WindowState} with a cached 
 * {@link RectangularPartCollection}.
 *
 */
public class VisiblePartsCachedState implements WindowState{
	
	private final RectangularPartCollection cachedParts;
	/**
	 * Constructor of {@link VisiblePartsCachedState}.
	 * @param cachedParts is the cached {@link RectangularPartCollection}.
	 */
	protected VisiblePartsCachedState(final RectangularPartCollection cachedParts) {
		this.cachedParts = cachedParts;
	}
	
	@Override
	public RectangularPartCollection getVisibleParts() {
		final RectangularPartCollection result = new RectangularPartCollection();
		result.add(this.cachedParts);
		return result;
	}
}
